package edu.ccut.saturn.studio.wfg.dialog.userdialog;

import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image;

import edu.ccut.saturn.studio.Activator;
import edu.ccut.saturn.studio.Images;

public class TreeViewerLabelProvider implements ILabelProvider {

	public Image getImage(Object element) {
		
		if(element instanceof OrgnazitionTree){
//			return ISaturnWorkflowIcons.ROOTICON;
			return Activator.getImage(Images.ROOTICON);
		} 
//		else if (element instanceof ISecondTree){
//			return ISaturnWorkflowIcons.SECONDICON;
//			return Activator.getImage(Images.SECONDICON);
		else if(element instanceof RolePack){
//			return ISaturnWorkflowIcons.ROOTICON;
			return Activator.getImage(Images.SECONDICON);
		} 
		else if(element instanceof OrgnizationPack){
//			return ISaturnWorkflowIcons.ROOTICON;
			return Activator.getImage(Images.SECONDICON_DEPARTMENT);
		}
			else if (element instanceof Role){
//			return ISaturnWorkflowIcons.ROLEICON;
			return Activator.getImage(Images.ROLEICON);
		} else if (element instanceof User){
//			return ISaturnWorkflowIcons.PERSONICON;
			return Activator.getImage(Images.PERSONICON);
		} else if (element instanceof Department){
//			return ISaturnWorkflowIcons.DEPARTMENTICON;
			return Activator.getImage(Images.DEPARTMENTICON);
		} else if (element instanceof Position){
//			return ISaturnWorkflowIcons.POSITIONICON;
			return Activator.getImage(Images.POSITIONICON);
		}
		
		return null;
	}

	@SuppressWarnings("unchecked")
	public String getText(Object element) {
		ITreeEntry entry = (ITreeEntry) element;
		return entry.getName();
	}

	public void addListener(ILabelProviderListener listener) {
	}

	public void dispose() {
	}

	public boolean isLabelProperty(Object element, String property) {
		return false;
	}

	public void removeListener(ILabelProviderListener listener) {
	}
}
